package com.dlc.shop.bean.dto.wukong;

import io.swagger.v3.oas.annotations.media.Schema;

import java.util.List;

/**
 * @author TRACK
 */
public class MessageSendDTO {

    @Schema(description = "消息头")
    private HeaderDTO header;

    @Schema(description = "发送者uid")
    private String from_uid;

    @Schema(description = "流式消息编号，如果是流式消息，需要指定，否则为空")
    private String stream_no;

    @Schema(description = "频道的唯一ID")
    private String channel_id;

    @Schema(description = "频道的类型 1.个人频道 2.群聊频道")
    private Integer channel_type;

    @Schema(description = "消息内容，base64编码")
    private String payload;

    @Schema(description = "订阅者集合 [uid1,uid2,...]")
    private List<String> subscribers;

    public MessageSendDTO() {
    }

    public MessageSendDTO(HeaderDTO header, String from_uid, String channel_id) {
        this.header = header;
        this.from_uid = from_uid;
        this.channel_id = channel_id;
        this.channel_type = 2;
        this.stream_no = "";
    }


    public MessageSendDTO(HeaderDTO header, String from_uid, String payload, List<String> subscribers) {
        this.header = header;
        this.from_uid = from_uid;
        this.payload = payload;
        this.subscribers = subscribers;
    }

    public HeaderDTO getHeader() {
        return header;
    }

    public void setHeader(HeaderDTO header) {
        this.header = header;
    }

    public String getFrom_uid() {
        return from_uid;
    }

    public void setFrom_uid(String from_uid) {
        this.from_uid = from_uid;
    }

    public String getStream_no() {
        return stream_no;
    }

    public void setStream_no(String stream_no) {
        this.stream_no = stream_no;
    }

    public String getChannel_id() {
        return channel_id;
    }

    public void setChannel_id(String channel_id) {
        this.channel_id = channel_id;
    }

    public Integer getChannel_type() {
        return channel_type;
    }

    public void setChannel_type(Integer channel_type) {
        this.channel_type = channel_type;
    }

    public String getPayload() {
        return payload;
    }

    public void setPayload(String payload) {
        this.payload = payload;
    }

    public List<String> getSubscribers() {
        return subscribers;
    }

    public void setSubscribers(List<String> subscribers) {
        this.subscribers = subscribers;
    }

    @Override
    public String toString() {
        return "MessageSendDTO{" +
                "header=" + header +
                ", from_uid='" + from_uid + '\'' +
                ", stream_no='" + stream_no + '\'' +
                ", channel_id='" + channel_id + '\'' +
                ", channel_type=" + channel_type +
                ", payload=" + payload +
                ", subscribers=" + subscribers +
                '}';
    }
}

